import timeit 
from RadixSort import radix_sort
from ShellSort import shell_sort
from SelectionSort import selection_sort
from RandomList import GetRandomList
from QuickSort import partition, quick_sort
from BucketSort import bucket_sort
from MergeSort import merge_sort
from BinaryInsertionSort import binary_insertion_sort
from TimSort import tim_sort
from MaxHeapSort import max_heap_sort
from DualPivotQuickSort import dual_pivot_quick_sort
from IntroSort import intro_sort_main
from CombSort import comb_sort
from TreeSelectingSort import tree_selecting_sort
import sys

if __name__ == "__main__":
    sys.setrecursionlimit(120000)
    Arr = GetRandomList(50000)
    print("System Quick Sort Running Time is " + str(round(timeit.timeit(lambda :sorted(Arr), number = 1) * 1000, 3 )) + " ms")
    print("Intro Sort Running Time is " + str(round(timeit.timeit(lambda :intro_sort_main(Arr), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    print("Quick Sort Running Time is " + str(round(timeit.timeit(lambda :quick_sort( Arr,0, len(Arr) - 1), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    # print("Selection Sort Running Time is " + str(round(timeit.timeit(lambda :selection_sort(Arr), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    print("Comb Sort Running Time is " + str(round(timeit.timeit(lambda :comb_sort( Arr), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    print("Shell Sort Running Time is " + str(round(timeit.timeit(lambda :shell_sort(Arr), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    print("Radix Sort Running Time is " + str(round(timeit.timeit(lambda :radix_sort(Arr), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    print("Bucket Sort Running Time is " + str(round(timeit.timeit(lambda :bucket_sort(Arr, 5), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    print("Merge Sort Running Time is " + str(round(timeit.timeit(lambda :merge_sort(Arr), number = 1) * 1000, 3 )) + " ms")
    # Arr = GetRandomList(50000)
    # print("Bucket Sort Running Time is " + str(round(timeit.timeit(lambda :binary_insertion_sort(Arr), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    print("Tim Sort Running Time is " + str(round(timeit.timeit(lambda :tim_sort(Arr), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    print("Max Heap Sort Running Time is " + str(round(timeit.timeit(lambda :max_heap_sort(Arr), number = 1) * 1000, 3 )) + " ms")
    Arr = GetRandomList(50000)
    print("Dual Pivot Sort Running Time is " + str(round(timeit.timeit(lambda :dual_pivot_quick_sort(Arr, 0 ,len(Arr) - 1), number = 1) * 1000, 3 )) + " ms")
    # Arr = GetRandomList(50000)
    # print("Dual Pivot Sort Running Time is " + str(round(timeit.timeit(lambda :tree_selecting_sort(Arr), number = 1) * 1000, 3 )) + " ms")